package com.xjggb.demo.config;


import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class DeadRabbitMqConfiguration {
    /*
    * 声明注册fanoyut模式交换机
    * */
    @Bean
    public DirectExchange deaddirectExchange(){
   return new DirectExchange("dead_direct_exchange",true,false);
    }
    /*
    * 声明队列
    * */
    @Bean
    public Queue deadlsmsQueue(){

        return new Queue("dead.direct.queue",true);
    }

    @Bean
    public Binding deadlBinding(){
        return BindingBuilder.bind(deadlsmsQueue()).to(deaddirectExchange()).with("dead");
    }

}
